import { getStore, setStore } from '@/utils/store'
export default {
  data () {
    return {
      theme: '',
      themeList: [{
        label: '默认',
        value: 'default'
      }, {
        label: '边框',
        value: 'border'
      }]
    }
  },
  created () {
    const theme = getStore({ name: 'wf-theme' })
    if (theme || theme == '') this.theme = theme || 'default'
  },
  watch: {
    theme: {
      handler (val) {
        if (val) {
          Promise.resolve(require(`../styles/theme/${val}.scss`).default)
        }
        setStore({ name: 'wf-theme', content: val })
      },
      immediate: true
    },
  },
}